/**
 * Copyright &copy; 2012-2016 <a href="https://www.kaaction.com">KAA</a> All rights reserved All rights reserved.
 */
package com.kaaction.modules.mer.service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.kaaction.common.persistence.Page;
import com.kaaction.common.service.CrudService;
import com.kaaction.modules.mer.entity.OperationContentTag;
import com.kaaction.modules.mer.dao.OperationContentTagDao;

/**
 * 运营内容标签Service
 * @author huanghaiming
 * @version 2017-07-13
 */
@Service
@Transactional(readOnly = true)
public class OperationContentTagService extends CrudService<OperationContentTagDao, OperationContentTag> {

	public OperationContentTag get(String id) {
		return super.get(id);
	}
	
	public List<OperationContentTag> findList(OperationContentTag operationContentTag) {
		return super.findList(operationContentTag);
	}
	
	public Page<OperationContentTag> findPage(Page<OperationContentTag> page, OperationContentTag operationContentTag) {
		return super.findPage(page, operationContentTag);
	}
	
	@Transactional(readOnly = false)
	public void save(OperationContentTag operationContentTag) {
		super.save(operationContentTag);
	}
	
	@Transactional(readOnly = false)
	public void delete(OperationContentTag operationContentTag) {
		super.delete(operationContentTag);
	}

	public String[] selTagId(String id) {
		 List<Map<String,Object>> listTagId = super.dao.selTagId(id);
		 if(listTagId!=null&&listTagId.size()>0){
			 List<String> listStr = new ArrayList<String>();
			 for(Map<String,Object> map :listTagId){
				 listStr.add((String) map.get("tagId"));
			 }
			 return listStr.toArray(new String[listStr.size()]);
		 }
		return null;
	}

	public List<Map<String,Object>> selTag() {
		return super.dao.selTag();
	}
	
}